var t,
  a,
  n,
  e = require("../../@babel/runtime/helpers/defineProperty"),
  i = require("../../res/www.a9a.cn.js"),
  r = getApp(),
  s = 2,
  o = !0;
Page(
  ((t = {
    data: {
      currentTab: "index",
      div_right_flag: !1,
      triggered: !0,
      loading_flag: !1,
      loading_ico_flag: !1,
      loading_str: "玩命加载中",
    },
    topbarFn: function (t) {
      var a = t.currentTarget.dataset.t;
      this.setData({ currentTab: a, t: a }), (n = { t: a }), this.init();
    },
    onLoad: function (t) {
      var a = this;
      r.get_config("_ZEAI").then(function (n) {
        a.setData({ color: n.color, rgbcolor: i.c16_rgb(n.color), qid: t.qid }),
          (s = 2),
          (o = !0),
          r.get_navigationBarTopHeight(a),
          r.get_openid().then(function (t) {
            a.init();
          });
      });
    },
    init: function () {
      var t = this;
      wx.showLoading({ title: t.data.loading_str, mask: !0 }), (o = !1);
      var s = {
        submitok: "trend",
        openid: (a = wx.getStorageSync("COOK_U")).openid,
        qid: t.data.qid,
      };
      i.empty(n) ||
        (s = JSON.parse(
          (JSON.stringify(s) + JSON.stringify(n)).replace(/}{/, ",")
        )),
        r.ajax({
          url: "qun.php",
          data: s,
          success: function (a) {
            var n;
            1 == a.flag
              ? 0 == a.LIST.length
                ? t.setData({ LIST: [], trendSO: a.SO, trend_nodata: !0 })
                : t.setData(
                    (e((n = {}), "LIST[0]", a.LIST),
                    e(n, "trendSO", a.SO),
                    e(n, "trend_nodata", !1),
                    n)
                  )
              : ((a.this = t), (a.url = "no"), i.sorry(a));
            (o = !0), wx.hideLoading();
          },
        });
    },
    trend_tab2Fn: function (t) {
      var a = t.currentTarget.dataset.t;
      (n = { t: a }), this.setData({ t: a, trend_nodata: !1 }), this.init();
    },
    trend_addFn: function () {
      var t = this;
      r.chklogin().then(function (a) {
        a
          ? wx.navigateTo({ url: "qun_trend_add?qid=" + t.data.qid })
          : t.setData({ div_login: !0 });
      });
    },
    delmyFn: function (t) {
      var n = this;
      r.chklogin().then(function (e) {
        if (e) {
          var s = t.currentTarget.dataset.id;
          wx.showModal({
            title: "",
            content: "确定要删除么？\n删除后不可恢复",
            confirmColor: n.data.color,
            cancelText: "取消",
            confirmText: "确定",
            success: function (t) {
              t.confirm &&
                r.ajax({
                  url: "trend.php",
                  data: { submitok: "trend_del", id: s, openid: a.openid },
                  success: function (t) {
                    1 == t.flag
                      ? n.init()
                      : ((t.this = n), (t.url = "no"), i.sorry(t));
                  },
                });
            },
          });
        } else n.setData({ div_login: !0 });
      });
    },
    zoom9Fn: function (t) {
      var a = t.currentTarget.dataset.cur,
        n = t.currentTarget.dataset.idx,
        e = t.currentTarget.dataset.idx2;
      i.empty(a) ||
        wx.previewImage({ current: a, urls: this.data.LIST[n][e].pic_arr });
    },
    trend_soFn: function () {
      this.setData({
        div_right_mask_class: "alpha0_100",
        div_right_box_class: "div_leftAnm1",
        div_right_flag: !0,
      });
    },
    SO_uid_bindblurFn: function (t) {
      var a = t.detail.value;
      this.setData({ keyword: a });
    },
    div_right_close_Fn: function () {
      var t = this;
      this.setData({
        div_right_mask_class: "alpha100_0",
        div_right_box_class: "div_leftAnm2",
      }),
        setTimeout(function () {
          t.setData({ div_right_flag: !1 });
        }, 500);
    },
    div_right_boxFn: function () {},
    trend_form_uid_submitFn: function (t) {
      var a = t.detail.value.keyword;
      (n = { keyword: a }), this.div_right_close_Fn(), this.init();
    },
    trend_input_uid_submitFn: function (t) {
      var a = t.detail.value;
      (n = { keyword: a }), this.div_right_close_Fn(), this.init();
    },
    trend_form_ext_liFn: function (t) {
      var a,
        n = t.currentTarget.dataset.idx,
        r = t.currentTarget.dataset.v,
        s = t.currentTarget.dataset.fkind,
        o = this.data.trendSO[n].v;
      (a = i.empty(o)
        ? r
        : "checkbox" == s
        ? i.indexOf(o, r)
          ? (a = i.json_remove(o, r)).join(",")
          : o + "," + r
        : r),
        0 == r && (a = 0),
        this.setData(e({}, "trendSO[" + n + "].v", a));
    },
    trend_form_ext_submitFn: function (t) {
      ((n = t.detail.value).keyword = this.data.keyword),
        this.div_right_close_Fn(),
        this.init();
    },
    trend_form_ext_resetFn: function (t) {
      var a = this.data.trendSO;
      for (var n in a) this.setData(e({}, "trendSO[" + n + "].v", 0));
      this.setData({ keyword: "" });
    },
  }),
  e(t, "trend_soFn", function () {
    this.setData({
      div_right_mask_class: "alpha0_100",
      div_right_box_class: "div_leftAnm1",
      div_right_flag: !0,
    });
  }),
  e(t, "setloading", function (t, a) {
    "start" == t
      ? this.setData({ loading_flag: !0, loading_ico_flag: !0, loading_str: a })
      : this.setData({
          loading_flag: !1,
          loading_ico_flag: !1,
          loading_str: a,
        });
  }),
  e(t, "gzFn", function (t) {
    var n = this,
      s = t.currentTarget.dataset.idx,
      o = t.currentTarget.dataset.idx2,
      d = t.currentTarget.dataset.uid;
    r.chklogin().then(function (t) {
      t
        ? ((a = wx.getStorageSync("COOK_U")),
          r.ajax({
            url: "u.php",
            data: { submitok: "ajax_gz", uid: d, openid: a.openid },
            success: function (t) {
              1 == t.flag
                ? (n.setData(
                    e({}, "LIST[" + s + "][" + o + "].gzclass", t.gzclass)
                  ),
                  wx.showToast({ title: t.msg, icon: "none", mask: !0 }))
                : ((t.this = n), (t.url = "no"), i.sorry(t));
            },
          }))
        : n.setData({ div_login: !0 });
    });
  }),
  e(t, "bind_dl", function (t) {
    var a = t.currentTarget.dataset.uid;
    wx.navigateTo({ url: "../u/u?uid=" + a });
  }),
  e(t, "dataFn", function () {
    wx.navigateTo({ url: "../reg/reg" });
  }),
  e(t, "mask_closeFn", function (t) {
    var a = this,
      n = t.currentTarget.dataset.maskid;
    this.setData({ mask_class: "alpha100_0" }),
      setTimeout(function () {
        a.setData(e({}, n, !1));
      }, 500);
  }),
  e(t, "back", function () {
    this.setData({ div_login: !1 });
  }),
  e(t, "agreeFn", function (t) {
    var n = this,
      s = t.currentTarget.dataset.idx,
      o = t.currentTarget.dataset.idx2,
      d = t.currentTarget.dataset.id;
    r.chklogin().then(function (t) {
      t
        ? ((a = wx.getStorageSync("COOK_U")),
          r.ajax({
            url: "trend.php",
            data: { submitok: "ajax_agree", tid: d, openid: a.openid },
            success: function (t) {
              if (1 == t.flag) {
                var a,
                  r = n.data.LIST[s][o].agree_arr.length;
                n.setData(
                  (e((a = {}), "LIST[" + s + "][" + o + "].agreefly", "block"),
                  e(a, "LIST[" + s + "][" + o + "].agree_arr[" + r + "]", {
                    uid: t.uid,
                    photo_s: t.photo_s,
                  }),
                  a)
                );
              } else (t.this = n), (t.url = "no"), i.sorry(t);
            },
          }))
        : n.setData({ div_login: !0 });
    });
  }),
  e(t, "bbsFn", function (t) {
    var a = this,
      n = this;
    r.chklogin().then(function (e) {
      if (e) {
        var i = t.currentTarget.dataset.idx,
          r = t.currentTarget.dataset.idx2,
          s = t.currentTarget.dataset.id;
        a.setData({
          bbsFormFlag: !0,
          bbs_content: "",
          bbs_form_id: s,
          bbs_form_idx: i,
          bbs_form_idx2: r,
        }),
          setTimeout(function () {
            n.setData({ bbs_content_focus: !0 });
          }, 500);
      } else n.setData({ div_login: !0 });
    });
  }),
  e(t, "bbsFormMaskFn", function () {
    this.setData({ bbsFormFlag: !1, bbs_content_focus: !1 });
  }),
  e(t, "bbs_submitFn", function (t) {
    var n = this;
    r.chklogin().then(function (s) {
      s
        ? wx.showModal({
            title: "温馨提醒",
            content:
              "确定提交么？\n以下情形话题将被删除或封号：\n1．请勿留下任何形式联系方法\n2．请勿发表涉黄涉政相关言论\n3．请勿发表辱骂攻击他人言论",
            confirmColor: n.data.color,
            cancelText: "取消",
            confirmText: "确定",
            success: function (s) {
              if (s.confirm) {
                var o = t.currentTarget.dataset.idx,
                  d = t.currentTarget.dataset.idx2,
                  c = t.currentTarget.dataset.id,
                  u = t.detail.value.bbs_content;
                (a = wx.getStorageSync("COOK_U")),
                  r.ajax({
                    url: "qun.php",
                    data: {
                      submitok: "bbs_add",
                      fid: c,
                      qid: n.data.qid,
                      content: u,
                      openid: a.openid,
                    },
                    success: function (t) {
                      if (1 == t.flag) {
                        var a,
                          r = n.data.LIST[o][d].bbs_arr.length;
                        n.setData(
                          (e(
                            (a = {}),
                            "LIST[" + o + "][" + d + "].bbs_class",
                            t.ARR.bbs_class
                          ),
                          e(
                            a,
                            "LIST[" + o + "][" + d + "].bbs_arr[" + r + "]",
                            t.ARR.bbs_arr
                          ),
                          e(a, "bbsFormFlag", !1),
                          e(a, "bbs_content_focus", !1),
                          a)
                        );
                      } else (t.this = n), (t.url = "no"), i.sorry(t);
                    },
                  });
              }
            },
          })
        : n.setData({ div_login: !0 });
    });
  }),
  e(t, "getPhoneNumber", function (t) {
    r.getPhoneNumber({ e: t, url: "../reg/reg", urlkind: "navigateTo" });
  }),
  e(t, "trend_topFn", function (t) {
    var a = this;
    wx.vibrateShort({ type: "heavy" }),
      setTimeout(function () {
        a.setData({
          triggered: !1,
          LIST: [],
          currentTab: "index",
          keyword: "",
        }),
          (n = {}),
          a.setloading("end", a.data.loading_str),
          (s = 2),
          a.init();
      }, 500);
  }),
  e(t, "trend_btmFn", function (t) {
    var d = this.data.LIST,
      c = this;
    if (o) {
      (o = !1), c.setloading("start", c.data.loading_str);
      var u = { submitok: "trend", p: s, openid: a.openid, qid: c.data.qid };
      i.empty(n) ||
        (u = JSON.parse(
          (JSON.stringify(u) + JSON.stringify(n)).replace(/}{/, ",")
        )),
        r.ajax({
          url: "qun.php",
          data: u,
          success: function (t) {
            if (1 == t.flag) {
              var a = d.length;
              if (t.LIST.length < 1)
                return c.setloading("end", "已全部加载完毕"), void (o = !1);
              c.setData(e({}, "LIST[" + a + "]", t.LIST)), s++;
            } else wx.showToast({ title: t.msg, icon: "none", mask: !0 });
            c.setloading("end", "上拉加载更多"), (o = !0);
          },
        });
    }
  }),
  e(t, "binnd_scroll_index", function (t) {
    t.detail.scrollTop > 100
      ? this.setData({ backtop_flag_index: !0 })
      : this.setData({ backtop_flag_index: !1 });
  }),
  e(t, "backtopFn", function (t) {
    var a = "scrolltopNum_" + t.currentTarget.dataset.id;
    this.setData(e({}, a, 0));
  }),
  t)
);
